from mcp.server.fastmcp import FastMCP

mcp = FastMCP("math mcp")

@mcp.tool()
def add(a:int, b:int) -> int:
    """Add two numbers"""
    return a + b

@mcp.tool()
def minus(a:int, b:int) -> int:
    """minus two numbers"""
    return a - b
# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"

if __name__ == "__main__":
    print("server start!")
    mcp.run(transport='stdio')